An inkjet printer includes a print head with a plurality of nozzles formed thereon, which performs printing onto a recording sheet (printing medium) by ejecting ink from the nozzles. There is an inkjet printer further includes a head cap that seals the print head when a printing operation is not performed (hereinafter referred to as a non-printing state), which suppresses drying of ink that adheres to the nozzles and maintains the ejecting state of the nozzles. However, even if the nozzles of the print head are sealed with the head cap, ink that adheres to the nozzles dries little by little. Thus, when the non-printing state continues over a long period of time, ink adhering to the nozzles dries, and as a result, the viscosity of the ink increases. Ink with high viscosity clogs up the nozzles, which may causes ejecting failure that the ink is not properly ejected from the nozzles.
U.S. Pat. No. 6,299,277 discloses an inkjet printer that measures a time period over which a print head is in contact with a head cap and regularly removes thickened ink adhering to the print head based on results of the measurement.
However, when the above inkjet printer is in a printing state (during a printing operation), the head cap is separated from the print head, and thus, the head cap is exposed to air and the inside thereof dries. Even if the inkjet printer thereafter goes into the non-printing state again and the nozzles of the print head are sealed with the head cap, since the humidity of the inside of the head cap is reduced due to drying, ink adhering to the nozzles dries quickly. Accordingly, appropriate timing for removing the thickened ink cannot be detected only by measuring the time period over which the print head is in contact with the head cap. This is because the appropriate timing for removing the thickened ink varies depending on the dryness of the inside of the head cap. Shortening an interval between the thickened ink removing operations and performing frequent thickened ink removing operations enable a decrease a possibility of the ejecting failure but lead to an increase of a waste of ink.